home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / gsplit.bat < prev    next >
DOS Batch File  |  1994-06-01  |  2KB  |  46 lines

  1. @echo off
  2. if %1.==. goto usage
  3. REM setlocal
  4. set parms=
  5. set k8option=
  6. goto get_opt1
  7. :GET_OPTS
  8. shift
  9. :GET_OPT1
  10. REM Scan through the options, checking for validity and especially looking for
  11. REM the 'k' option since this will be used for the call to gcc to get the offset
  12. REM information.
  13. if %1.==-k. set k8option=-k8
  14. if %1.==-k. goto get_opts
  15. if %1.==-s. set parms=%parms% %1
  16. if %1.==-s. goto get_opts
  17. if %1.==-w. set parms=%parms% %1
  18. if %1.==-w. goto get_opts
  19. REM Check that there is a filename argument after the option list, and that the
  20. REM file actually exists.
  21. if %1.==. echo missing filename
  22. if %1.==. goto usage
  23. if not exist %1 echo %1 not found
  24. if not exist %1 goto end
  25. REM Call gnatf on the source filename argument with special options to generate
  26. REM offset information. If this special compilation completes succesfully call
  27. REM the gnatchop program to actuall split the source file in one file per
  28. REM compilation unit in the optional directory if given otherwise in the current
  29. REM directory.
  30. gnatf -s -u %k8option% %1 >tmpfile
  31. if errorlevel 1 echo parse errors detected
  32. if errorlevel 1 goto end
  33. gnatchop %parms% %1 %2 <tmpfile
  34. erase tmpfile
  35. goto end
  36. :USAGE
  37. echo Usage : gnatsplit [-k] [-s] [-w] filename [directory]
  38. echo.
  39. echo   k         limit filenames to 8 characters
  40. echo   s         generate a compilation script
  41. echo   w         overwrite existing filenames
  42. echo   filename  source file
  43. echo   directory directory to place split files (default is the current directory)
  44. :END
  45. 
  46.